package com.np.media1;

import androidx.appcompat.app.AppCompatActivity;

import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoViewActivity extends AppCompatActivity {

    String url = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
    VideoView videoView1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_view);

        videoView1 = findViewById(R.id.videoView1);
        init();
    }

    private void init(){
        Uri uri = Uri.parse(url);
        videoView1.setMediaController(new MediaController(VideoViewActivity.this));
        videoView1.setVideoURI(uri);
        videoView1.start();
        videoView1.requestFocus();
    }
}